def solution(x_position, y_position):
    # Please write your code here
    x, y = x_position, y_position
    distance = abs(x - y)
    step = 1
    while True:
        step_multiply = 2 * step
        distance -= step_multiply
        if distance <= 0:
            break
        else:
            step += 1
    return 2 * step


if __name__ == "__main__":
    #  You can add more test cases here
    print(solution(12, 6) == 4)
    print(solution(34, 45) == 6)
    print(solution(50, 30) == 8)
